/*
 * Login.fx
 *
 * Created on 2009-04-05, 21:05:24
 */

package msquirrel;

import javafx.ext.swing.SwingButton;
import javafx.ext.swing.SwingLabel;
import javafx.ext.swing.SwingTextField;
import javafx.scene.Group;
import javafx.scene.paint.Color;
import javafx.scene.paint.LinearGradient;
import javafx.scene.paint.Stop;
import javafx.scene.Scene;
import javafx.scene.text.Font;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.scene.image.ImageView;
import javafx.scene.image.Image;
import java.lang.System;

/**
 * @author Krzysztof Wieczorek
 */

public class Login {

// Wysokość i szerokość okienka aplikacji
def stageWidth = 400;
def stageHeight = 300;

var loginstage:Stage;

var loginStage = Stage {
    title: "mSquirrel v0.1 - Notatki Wideo"
    width: stageWidth
    height: stageHeight
    visible: true
    style: StageStyle.UNDECORATED
    resizable: false

    scene: Scene {
        fill: LinearGradient {
            startX : 0.0
            startY : 0.0
            endX : 1.0
            endY : 1.0
            stops: [
                Stop {
                    color : Color.BISQUE
                    offset: 0.0
                },
                Stop {
                    color : Color.BLUE
                    offset: 1.0
                },

            ]
        }
        content: Group {
            content: [
                /*
                ImageView {
                    x:0
                    y:0
                    image: Image {
                        url: "{__DIR__}logo.jpg"
                    }
                }*/
                SwingLabel {
                    text: "Email:"
                    font: Font {name: "Arial", size: 11}
                    translateX: 31
                    translateY: 31
                    width: 50
                    height: 22
                }, SwingLabel {
                    text: "Has\u0142o:"
                    font: Font {name: "Arial", size: 11}
                    translateX: 31
                    translateY: 62
                    width: 50
                    height: 22
                }, SwingTextField {
                    text: ""
                    font: Font {name: "Arial", size: 11}
                    translateX: 83
                    translateY: 31
                    width: 110
                    height: 22
                }, SwingTextField {
                    text: ""
                    font: Font {name: "Arial", size: 11}
                    translateX: 83
                    translateY: 64
                    width: 110
                    height: 22
                }, SwingButton {
                    text: "zaloguj\n"
                    font: Font {name: "Arial", size: 11}
                    translateX: 82
                    translateY: 97
                    width: 80
                    height: 22
                }
                ImageView {
                    x:375
                    y:4
                    image: Image {
                        url: "{__DIR__}images/close.png"
                    }
                    onMousePressed: function(event) { System.exit(0); }
                }

            ]
        }
    }
}

public function getLoginStage() {
    return loginStage;
}

}
